/*package cn.meomis.common.security;

import java.io.IOException;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.log4j.Logger;
import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;
import org.springframework.stereotype.Service;

import cn.meomis.common.Constants;
import cn.meomis.model.User;
import cn.meomis.service.UserService;

@Service
public class AuthenticationSuccessHandler extends
		SavedRequestAwareAuthenticationSuccessHandler {

	static Logger logger = Logger.getLogger(AuthenticationSuccessHandler.class
			.getName());

	@Resource
	private UserService userInfoServiceImpl;

	public void setUserInfoServiceImpl(UserService userInfoServiceImpl) {
		this.userInfoServiceImpl = userInfoServiceImpl;
	}

	*//**
	 * 登陆成功后，在HttpSession中保存当前登录用户信息
	 *//*
	public void onAuthenticationSuccess(HttpServletRequest request,
			HttpServletResponse response, Authentication authentication)
			throws ServletException, IOException {
		HttpSession session = request.getSession();
		NewUserInfo userDetails = (NewUserInfo) authentication.getPrincipal();
		User user = null;
		try {
			user = userInfoServiceImpl.findUserByEmailAndState(userDetails.getUsername(), Constants.USER_NORMAL_STATE);
		} catch (Exception e) {
			logger.error("登录时获取用户信息异常", e);
		}
		if (user != null) {
			logger.info(user.getUserid() + "_" + user.getUserrealname() + 
					"登陆成功后，在HttpSession中保存当前登录用户信息");
			
//			userInfoServiceImpl.updateUserLoginTime(user.getUserid());
			session.setAttribute(Constants.ATR_CURRENT_USERINFO, user);
//			session.setAttribute(Constants.ATR_USER_MENU, getMenu(user));
//			session.setAttribute(Constants.ATR_AUTH_ITEMS, getAuthItem(user));
			
		}
		super.onAuthenticationSuccess(request, response, authentication);
	}

	// 获取指定用户所属角色的一级、二级菜单。
	private Map<String,Object> getMenu( User user){
		// XXX
		return null;
	}
	
	// 获取指定用户所属角色的权限列表
	private List<String> getAuthItem( User user){
		// XXX
		return null;
	}
}
*/